package com.youthburin.rmp.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Sort;
import org.springframework.data.domain.Sort.Direction;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.youthburin.rmp.services.RmpNoticeService;

@Controller
public class HomeController {
	@Autowired
	private RmpNoticeService rmpNoticeService;

	@RequestMapping(value = "/home", method = RequestMethod.GET)
	public String edit(ModelMap model) {
		model.put("noticeList", rmpNoticeService.findAll(new Sort(Direction.DESC, "id")));
		return "home";
	}
}
